﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using Xunit;

namespace NPack.Tests
{
    public class TComponentPerformanceTests
    {
        [Fact]
        public void TestAdditionPerf()
        {
            int count = 10000000;
            Stopwatch watch = new Stopwatch();
            watch.Start();
            for (int i = 0; i < count; i++)
            {
                double d = 1.0 + 1.0;
            }
            watch.Stop();
            Console.WriteLine(string.Format("double added in {0}", watch.ElapsedMilliseconds));

            watch.Reset();
            watch.Start();
            for (int i = 0; i < count; i++)
            {
                DoubleComponent component = new DoubleComponent(1.0).Add(new DoubleComponent(1.0));
            }
            watch.Stop();
            Console.WriteLine(string.Format("DoubleComponent added in {0}", watch.ElapsedMilliseconds));

        }
    }
}
